package com.shengyin.ec.model.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * 这个是评论实体
 * @author charlie
 *
 */
@Entity
public class Comment extends BaseEntity{
	@Column(nullable=false)
	private Integer score = 5;
	@Column(nullable=false,length=200)
	private String Content;
	@Column(nullable=false,length=20)
	private String ip;
	@Column(nullable=false)
	private Date createDate = new Date();
	@Column(nullable=false)
	private Date updateDate = new Date();
	@Column(nullable=false)
	private Boolean visible = true;
	@ManyToOne(cascade={CascadeType.MERGE,CascadeType.REFRESH})
	@JoinColumn(name="userId")
	private Personal user;
	@ManyToOne(cascade={CascadeType.MERGE,CascadeType.REFRESH})
	@JoinColumn(name="goodsId")
	private Goods goods;
	//==============setter/getter========================
	
	public Integer getScore() {
		return score;
	}
	public void setScore(Integer score) {
		this.score = score;
	}
	
	public String getContent() {
		return Content;
	}
	public void setContent(String content) {
		Content = content;
	}
	
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Date getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	public Boolean getVisible() {
		return visible;
	}
	public void setVisible(Boolean visible) {
		this.visible = visible;
	}
	
	public Personal getUser() {
		return user;
	}
	public void setUser(Personal user) {
		this.user = user;
	}
	
	public Goods getGoods() {
		return goods;
	}
	public void setGoods(Goods goods) {
		this.goods = goods;
	}
	
}
